//
//  BaseTableViewCell.m
//  ManBetX
//
//  Created by Cocoa on 2020/4/10.
//  Copyright © 2020 Fullen. All rights reserved.
//

#import "BaseTableViewCell.h"

@implementation BaseTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
}


- (void)configure:(id)entity {
    
    self.entity = entity;
}

/**
 *  自动返回cell的identifierId格式为【xib名称+Id】
 *
 *  @return 格式为【xib名称+Id】(如：XXXViewCellId)
 */
+(NSString*) getTableViewCellIdentifier {
    
    NSString *tempString = NSStringFromClass([self class]);
    NSArray *stringArray = [tempString componentsSeparatedByString:@"."];
    if (stringArray.count>0) {
        return [NSString stringWithFormat:@"%@Id",stringArray.lastObject];
    }
    return [NSString stringWithFormat:@"%@Id",tempString];
}


+ (void)registerToTableView:(UITableView *)tableView {
    
    [tableView registerNib:[UINib nibWithNibName:NSStringFromClass([self class]) bundle:nil ] forCellReuseIdentifier:[[self class] getTableViewCellIdentifier]];
}

@end
